package com.gameShare.mappers.user

import com.gameShare.entity.dto.game.GameCollectionDto
import com.gameShare.entity.dto.user.UserCollectionFolderDto
import org.apache.ibatis.annotations.Param

interface UserCollectionMapper {

    fun createCollectionFolder(
        @Param("name") folderName : String,
        @Param("userId") userId : String,
        @Param("permission") permission : Int
    ) : Int

    fun addGameToCollectionFolder(
        @Param("gameId") gameId : String,
        @Param("collectionFolderId") collectionFolderId : Int
    ) : Int

    fun checkGameInCollectionExist(
        @Param("gameId") gameId: String,
        @Param("collectionFolderId") collectionFolderId: Int
    ) : Int


    fun updateCollectionFolderName(
        @Param("name") name: String?,
        @Param("permission") permission: Int?,
        @Param("collectionFolderId") collectionFolderId : Int
    ) : Int

    fun deleteCollectionFolder(
        @Param("collectionFolderId") collectionFolderId: Int
    ) : Int

    fun selectUserAllFolder(
        @Param("userId") userId : String,
        @Param("permission") permission: Int?
    ) : List<UserCollectionFolderDto>

    fun selectCollectionGamesByPage(
        @Param("collectionFolderId") collectionFolderId: Int,
        @Param("start") start : Int,
        @Param("end") end : Int
    ) : List<GameCollectionDto>

    fun deleteGameInCollectionFolder(@Param("gameId") gameId: String) : Int


    fun selectGameCollectionUser(@Param("collectionFolderId") collectionFolderId : Int) : String

    fun selectCollectionFolderPermission(@Param("collectionFolderId") collectionFolderId: Int) : Int

    fun selectUserCollectionNames(@Param("userId") userId : String) : List<String>?

    fun selectGameCountInCollection(
        @Param("collectionFolderId") collectionFolderId: Int,
    ) : Int

    fun checkCollectionFolderExist(@Param("collectionFolderId") collectionFolderId: Int) : Int



}